﻿using System;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;


namespace ProtetoresDaMata.Smarts
{
    public class Camera
    {
        public Matrix transform;
        public Viewport view;
        //private SpriteBatch spriteRenderer;
        private Vector2 centre; // top left corner of the camera

        public Camera(Viewport view)
        {
            this.view = view;
        }

        public Vector2 Position
        {
            get { return centre; }
            set { centre = value; }
        }

        public void Update(GameTimerEventArgs timer, GamePage anchor)
        {
            centre = new Vector2(anchor.character.Position.X + (anchor.character.Texture.Width / 2) - 100, 0);
            transform = Matrix.CreateScale(new Vector3(1, 1, 0)) * Matrix.CreateTranslation(new Vector3(-centre.X, -centre.Y, 0));
        }

    }
}
